﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dreamz
{
    [Serializable()]
    public class Item
    {
       //This class is used to describe the ITEM-objects. Also used to get items from string.
        public string[] Names;
        public string Description;
        public EventHandler OnUse;
        public EventHandler OnTake;
        public EventHandler OnLook;
        public bool CanPickUp;

        public Item(string[] Names, string Description)
        {
            this.Names = Names;
            this.Description = Description;
        }

        static public Item FromString(string String)
        {
            string[] itemAttrs = String.Split('#');

            Item newItem = new Item(itemAttrs[0].Split('|'), itemAttrs[1]);

            if (itemAttrs.Length > 2)
               newItem.CanPickUp = true;

            return newItem;


        }
    }
}